<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body style="font-family:Arial, Helvetica, sans-serif">
<p>Special Code</p>
<form id="form3" name="form3" method="post" action="">
  Choose Product Type /SubType First ,Default is Battery<br />
  <select name="id_maintype_sp_code" id="id_maintype_sp_code">

  <?php 
  foreach ($this->mainlist as $k1=>$v1){
	  $chkstr="";
	  if($this->idMain == $v1['id_type']){
		  
		  $chkstr='selected="selected"';
		  }
	  
	  if($v1['w_sp_code']== 1){
	  ?>
       <option value="<?php echo $v1['id_type']?>" <?php echo $chkstr?> ><?php echo $v1['des_type']?></option>   
  <?php	  
	  }
	  }
  ?>
  </select>
  <input type="submit" name="sub_go" id="sub_go" value="GO" />
</form>
<p><br />
</p>
<table width="800" border="0" cellspacing="0" cellpadding="5">
  <form id="form2" name="form2" method="post" action="">
  <tr>
    <td style="width:100px" >ID</td>
    <td style="width:100px" >CODE</td>
    <td style="width:600px" >Description</td>
  </tr>
 <?php 
 if(isset($this->spcodelist)){
 foreach($this->spcodelist as $key => $value){
 ?> 
  <tr>
    <td><span style="width:400px">
      <input name="row[<?php echo $value['id_special']?>][id]" type="text" id="row[<?php echo $value['id_special']?>][id]" style="width:50px;" value="<?php echo $value['id_special']?>" readonly="readonly" />
    </span></td>
    <td><span style="width:400px">
      <input type="text" name="row[<?php echo $value['id_special']?>][code]" id="row[<?php echo $value['id_special']?>][code]" style="width:100px;"  value="<?php echo $value['code_special_code']?>" />
    </span></td>
    <td><span style="width:400px">
      <input type="text" name="row[<?php echo $value['id_special']?>][des]" id="row[<?php echo $value['id_special']?>][des]" style="width:350px;"  value="<?php echo $value['des_special_code']?>" />
    </span></td>
  </tr>
 <?php 
 }
 }
 ?> 
  <tr>
    <td colspan="3">
      <input type="hidden" name="id_maintype" id="id_maintype" value="<?php echo $this->idMain?>" />	
      <input type="submit" name="sub_1" id="sub_1" value="Modify" />
</td>
  </tr>
    </form>  
</table>
<p><br />
  Add New<br />
</p>
<table width="600" border="0" cellspacing="0" cellpadding="10">
<form id="form1" name="form1" method="post" action="">
  <tr>
    <td style="width:200px" >Manufacure</td>
    <td style="width:400px" ><label for="id_add_manu"></label>
      <?php
      $mainType = new Model_DbTable_Barcodeproducttype();
	  echo  $mainType->getTypeDes($this->idMainType);
	  ?>
      <input type="hidden" name="id_add_main" id="id_add_main" value="<?php echo $this->idMain?>" /></td>
  </tr>
  <tr>
    <td>Code:</td>
    <td><span style="width:400px">
      <input type="text" name="code_add_sp_code" id="code_add_sp_code" />
    </span></td>
  </tr>
  <tr>
    <td>Description:</td>
    <td><span style="width:400px">
      <input type="text" name="des_add_sp_code" id="des_add_sp_code" style="width:350px;" />
    </span></td>
  </tr>
  <tr>
    <td colspan="2">
      <input type="submit" name="sub_2" id="sub_2" value="Add" />
</td>
  </tr>
  </form>  
</table>
<p>  <br />
</p>
</body>
</html>
